<?php
$pathArr = explode("/", $_SERVER["PHP_SELF"]);
$contextPath = $pathArr[1];
$rootPath = $_SERVER["DOCUMENT_ROOT"];
?>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Admin Panel</title>
		<?php
			require_once($rootPath . "/" . $contextPath . "/includes/css_inc.php");
			require_once($rootPath . "/" . $contextPath . "/includes/js_inc.php");
		?>
              <script>
                  jQuery(document).ready(function(){
                       jQuery('#list5').jqGrid({
                            url:'../test.php',
                            mtype:'GET',
                            datatype: 'json',
                            colNames:['id','User Name', 'fname', 'lname','address','telephone','email','job'],
                            colModel:[
                                    {name:'id',index:'id', width:55, sorttype:"int"},
                                    {name:'user_name',index:'user_name', width:70, sorttype:"string"},
                                    {name:'fname',index:'fname', width:70, sorttype:"string"},
                                    {name:'lname',index:'lname', width:80, align:'left', sorttype:"string"},
                                    {name:'address',index:'address', width:150, align:'left', sortable:false},
                                    {name:'telephone',index:'telephone', width:80, align:'left', sorttype:"string"},
                                    {name:'email',index:'email', width:80, align:'left', sorttype:"string"},
                                    {name:'job',index:'job', width:80, align:'left', sorttype:"string"},
                            ],
                            row:10,
                            rowList:[10,20,30],
                            height: 'auto',
                            pager: '#pager5',
                            sortname: 'id',
                            viewrecords: true,
                            caption:"JSON Example"
                        });
                        jQuery("#list5").jqGrid('navGrid','#pager5',{del: false, add: false, edit: false,search:true,refresh:true});
                    });
              </script>
        </head>
        <body>
                <table id="list5"></table>
                <div id="pager5"></div>
        </body>
</html>
